<include file="public/header"/>
<style>
body{font-size:x-small}
.offercard_page{width:5.9rem;height:1.6rem;background:url(__STATIC__/images/offercard.png?1438789002) no-repeat;background-size:5.9rem 11.6rem;margin:0 auto; margin-top:10px; margin-bottom:10px;display: flex;}
.offercard_type1{background-position:0 -2.54rem}
.offercard_page .icon_doller{font-size:.48rem;font-style:normal;color:#FFF;opacity:0.7;float:left;margin:.20px 0 0 10px}
.offercard_page .offercard_price{font-family:Impact;font-size:0.5rem;;float:left;color:#FFF;opacity:0.7;margin:.6rem 0 0 .15rem;width:2.3rem;text-align:left;letter-spacing:-.1rem}
.offercard_page .offercard_price em{font-style:normal;font-size:1.2rem;margin-left:5px;}
.offercard_page .offercard_typename{float: right;margin-right: 0px;color: #fff;opacity: 0.7;font-size: 18px;margin-top: 1.04rem;margin-right: 0.1rem;}
.offercard_page .offercard_classfy{font-size: .24rem;color: #FFF;opacity: 0.7;margin: .25rem 0 0 0rem;width: 2.0rem;display: block;}
.offercard_page .offercard_type{font-size:.24rem;color:#FFF;opacity:0.7;float:left;margin:.1rem 0 0 .40rem;width:2.5rem}
.offercard_page .offercard_use{float:left;background:#72c039;height:.56rem;width:2.2rem;border-radius:.28rem;line-height:.56rem;text-align:center;color:#d5ffb7;margin:.25rem 0 0 .1rem}
.offercard_page .offercard_limit{width: 100%;float: left;margin: .2rem 0 .02rem .1rem;color: #61ac2b;}
.offercard_type2{background-position:0 -5.08rem}
.offercard_type2 .offercard_use{color:#c0ddff;background:#5ba0f1}
.offercard_type2 .offercard_limit{color:#3984dc}
.offercard_type3{background-position:0 -7.62rem}
.offercard_type3 .offercard_use{color:#ffa4aa;background:#e03c47}
.offercard_type3 .offercard_limit{color:#dd343f}
.offercard_type4{background-position:0 -10.16rem}
.offercard_type4 .offercard_use{color:#ffd6ae;background:#f2a456}
.offercard_type4 .offercard_limit{color:#e09041}
.offercard_over{background-position:0 0}
.offercard_over .offercard_use{color:#e9e9e9;background:#ccc}
.offercard_over .offercard_limit{color:#c4c4c4}
</style>
<script type="text/javascript">
	function remReSize(){var w = $(window).width();try{w = $(parent.window).width();}catch(ex){};if(w>640){w = 640;};$('html').css('font-size',100/640*w+'px');$('#js_style_for_pc').remove();$('body').append('<style id="js_style_for_pc">.m_header{margin-left: -'+w/2+'px;}.m_menu{margin-left: -'+w/2+'px;}</style>');};remReSize();$(window).resize(remReSize);$(document).ready(function() {remReSize();});for(var i=0;i<3;i++){setTimeout(remReSize, 100*i);};</script>
<body>
<header>
  <div class="tab_nav">
    <div class="header">
      <div class="h-left"><a class="sb-back" href="javascript:history.back(-1)" title="返回"></a></div>
      <div class="h-mid">我的优惠券</div>
      <div class="h-right">
        <aside class="top_bar">
          <div onClick="show_menu();$('#close_btn').addClass('hid');" id="show_more"><a href="javascript:;"></a> </div>
        </aside>
      </div>
    </div>
  </div>
</header>
<include file="public/menu"/>
<div class="order">
	<div class="Evaluation">
	      <ul>
	      	<li><a href="{:U('User/coupon',array('type'=>0))}" class="tab_head <if condition='$Request.param.type eq 0'>on</if>" id="goods_ka1">未使用</a></li>
	        <li><a href="{:U('User/coupon',array('type'=>1))}" class="tab_head <if condition='$Request.param.type eq 1'>on</if>" id="goods_ka2">已使用</a></li>
	        <li><a href="{:U('User/coupon',array('type'=>2))}" class="tab_head <if condition='$Request.param.type eq 2'>on</if>" id="goods_ka3">已过期</a></li>
	      </ul>
	</div>
	
	<div class="Emain" id="user_goods_ka_1" style="display:block">
		<volist name="coupon_list" id="coupon">
			<div class="offercard_page offercard_type<if condition="$Request.param.type eq 0">1</if><if condition="$Request.param.type eq 1">2</if><if condition="$Request.param.type eq 2">0</if>">
				<div><span class="offercard_price">&yen;<em><if condition="$coupon.money lt 1">{$coupon.money|sprintf="%.1f",###}<else/>{$coupon.money|intval}</if></em></span><span class="offercard_typename">券</span></div>
				<div>
				<span class="offercard_classfy">消费满{$coupon.condition}使用</span>
				<span class="offercard_limit">有效期{$coupon.use_start_time|date='Y-m-d',###}~{$coupon.use_end_time|date='Y-m-d',###}</span>
				</div>
				<i class="clear"></i>
			</div> 			
		</volist>
	</div> 	 
<notempty name="coupon_list">	
   <div id="getmore" style="font-size:.24rem;text-align: center;color:#888;padding:.25rem .24rem .4rem; clear:both">
  		<a href="javascript:void(0)" onClick="ajax_sourch_submit()">点击加载更多</a>
    </div>  	
</notempty>	
</div>
<script>
var  page = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_submit()
 {	 	 	 
        page += 1;
		$.ajax({
			type : "GET",
			url:"/index.php?m=Mobile&c=User&a=coupon&type={$Request.param.type}&is_ajax=1&p="+page,//+tab,
//			url:"{:U('Mobile/User/coupon',array('type'=>$_GET['type']),'')}/is_ajax/1/p/"+page,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				if($.trim(data) == '')
					$('#getmore').hide();
				else
				    $("#user_goods_ka_1").append(data);
			}
		}); 
 } 
</script>
<include file="public/footer"/>
</body>
</html>